guests = ['luoyunfu','zhouwengyu','luoyuanming','wangxue','luofuxuan']
print("A list of my invitations to dinner :")
print(guests)
print("\n"+guests[-1].title()+" could not keep the appointment.\n")
guests[-1] = "xiaojiejie"
print("A list of my invitations to dinner :")
print(guests)
guests.insert(0,"xiaoming")
guests.insert(3,"xiaohong")  #insert(添加在列表的哪个位置,"元素")可以添加在任何位置
guests.append("tanyiyu")     # append()是将元素添加到列表末尾
print("A list of my invitations to dinner :")
print(guests)
print("I am sorry,I can only invite tow guests to dinner")
guest_1=guests.pop(1)
print("I am sorry,"+guest_1.title()+".")
guest_2=guests.pop(1)
print("I am sorry,"+guest_2.title()+".")
guest_3=guests.pop(2)
print("I am sorry,"+guest_3.title()+".")
guest_4=guests.pop(2)
print("I am sorry,"+guest_4.title()+".")
guest_5=guests.pop(2)
print("I am sorry,"+guest_5.title()+".")
guest_6=guests.pop(2)
print("I am sorry,"+guest_6.title()+".")
print("I am invite "+guests[0]+".")
print("I am invite "+guests[1]+".")
del guests[0]
print(guests)
del guests[0]
print(guests)